<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use common\models\Category;

/* @var $this yii\web\View */
/* @var $model common\models\Article */
/* @var $form yii\widgets\ActiveForm */
use common\models\ArticleTxt;

$txt = $model['txt'];
$txt = empty($txt) ? new ArticleTxt() :$txt;
?>

<div class="article-form">

    <?php $form = ActiveForm::begin(); ?>



    <?= $form->field($model, 'cat')->dropDownList(ArrayHelper::map(Category::get(0, \common\utils\Com::cats()), 'id', 'label'),['prompt'=>'无']) ?>
    <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'keyword')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'info')->textInput(['maxlength' => true]) ?>

    <?= $form->field($txt,'text')->widget('kucha\ueditor\UEditor',[]);?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
